#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from abc import ABC, abstractmethod
from typing import List, Dict

class FilterRule(ABC):
    """过滤规则抽象基类"""
    
    @abstractmethod
    def should_filter(self, add_content: str, remove_content: str, hunk_changes: List[Dict]) -> bool:
        """判断是否应该过滤"""
        pass
    
    @abstractmethod
    def get_filter_reason(self) -> str:
        """获取过滤原因"""
        pass
    
    def get_rule_name(self) -> str:
        """获取规则名称"""
        return self.__class__.__name__ 